﻿namespace PC1
{
    public struct Command
    {
        public readonly Bcode Bcode;

        public readonly Opcode Opcode;

        public readonly byte R0;

        public readonly byte R1;

        public readonly byte R2;

        public readonly bool Signed;

        public Command(Opcode opcode, Bcode bcode, bool signed, byte r0, byte r1, byte r2)
        {
            Opcode = opcode;
            Bcode = bcode;
            Signed = signed;
            R0 = r0;
            R1 = r1;
            R2 = r2;
        }

        public Command(Opcode opcode, bool signed, byte r0, byte r1, byte r2)
            : this (opcode, Bcode.UN, signed, r0, r1, r2)
        {
        }

        public Command(Opcode opcode, Bcode bcode)
            : this (opcode, bcode, false, 0, 0, 0)
        {
        }

        public Command(Opcode opcode)
            : this(opcode, Bcode.UN, false, 0, 0, 0)
        {
        }
    }
}